package com.dailyblue.java.spring.boot.mvc.mybatis.controller;

import com.dailyblue.java.spring.boot.commons.bean.Reply;
import com.dailyblue.java.spring.boot.commons.util.JsonResult;
import com.dailyblue.java.spring.boot.mvc.mybatis.service.ReplyService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@RequestMapping("/reply")
@RestController
public class ReplyController {
    @Resource
    private ReplyService replyService;

    @GetMapping("/save")
    public JsonResult save(Reply reply, HttpServletRequest request) {
        return replyService.saveReply(reply, request.getHeader("token"));
    }
}
